using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.Office.Project.EPMAuditing.AuditListenerCatalog
{
    public class EventLogHelper
    {
        private EventLogHelper() { }

        #region Public methods

        public static short EventCategory(string sourceName)
        {
            switch (sourceName)
            {
                case "AdminEvents":
                    return (short)EventCategories.ADMIN_EVENTS_CATEGORY;
                case "CalendarEvents":
                    return (short)EventCategories.CALENDAR_EVENTS_CATEGORY;
                case "CubeAdminEvents":
                    return (short)EventCategories.CUBE_ADMIN_EVENTS_CATEGORY;
                case "CustomFieldsEvents":
                    return (short)EventCategories.CUSTOM_FIELDS_EVENTS_CATEGORY;
                case "LookupTableEvents":
                    return (short)EventCategories.LOOKUP_TABLE_EVENTS_CATEGORY;
                case "NotificationsEvents":
                    return (short)EventCategories.NOTIFICATIONS_EVENTS_CATEGORY;
                case "ProjectEvents":
                    return (short)EventCategories.PROJECT_EVENTS_CATEGORY;
                case "ReportingEvents":
                    return (short)EventCategories.REPORTING_EVENTS_CATEGORY;
                case "ResourceEvents":
                    return (short)EventCategories.RESOURCE_EVENTS_CATEGORY;
                case "RulesEvents":
                    return (short)EventCategories.RULES_EVENTS_CATEGORY;
                case "SecurityEvents":
                    return (short)EventCategories.SECURITY_EVENTS_CATEGORY;
                case "StatusingEvents":
                    return (short)EventCategories.STATUSING_EVENTS_CATEGORY;
                case "StatusReportsEvents":
                    return (short)EventCategories.STATUS_REPORTS_EVENTS_CATEGORY;
                case "TimesheetEvents":
                    return (short)EventCategories.TIMESHEET_EVENTS_CATEGORY;
                case "WssInteropEvents":
                    return (short)EventCategories.WSS_INTEROP_EVENTS_CATEGORY;
                default:
                    return (short)0;
            }
        }

        public static int EventId(string sourceName, string eventName)
        {
            switch (sourceName)
            {
                case "AdminEvents":
                    return AdminEventsID(eventName);
                case "CalendarEvents":
                    return CalendarEventsID(eventName);
                case "CubeAdminEvents":
                    return CubeAdminEventsID(eventName);
                case "CustomFieldsEvents":
                    return CustomFieldsEventsID(eventName);
                case "LookupTableEvents":
                    return LookupTableEventsID(eventName);
                case "NotificationsEvents":
                    return NotificationsEventsID(eventName);
                case "ProjectEvents":
                    return ProjectEventsID(eventName);
                case "ReportingEvents":
                    return ReportingEventsID(eventName);
                case "ResourceEvents":
                    return ResourceEventsID(eventName);
                case "RulesEvents":
                    return RulesEventsID(eventName);
                case "SecurityEvents":
                    return SecurityEventsID(eventName);
                case "StatusingEvents":
                    return StatusingEventsID(eventName);
                case "StatusReportsEvents":
                    return StatusReportsEventsID(eventName);
                case "TimesheetEvents":
                    return TimesheetEventsID(eventName);
                case "WssInteropEvents":
                    return WssInteropEventsID(eventName);
                default:
                    return (int)0;
            }
        }

        private enum EventCategories : short
        {
            ADMIN_EVENTS_CATEGORY = 0x01,
            CALENDAR_EVENTS_CATEGORY = 0x02,
            CUBE_ADMIN_EVENTS_CATEGORY = 0x03,
            CUSTOM_FIELDS_EVENTS_CATEGORY = 0x04,
            LOOKUP_TABLE_EVENTS_CATEGORY = 0x05,
            NOTIFICATIONS_EVENTS_CATEGORY = 0x06,
            PROJECT_EVENTS_CATEGORY = 0x07,
            REPORTING_EVENTS_CATEGORY = 0x08,
            RESOURCE_EVENTS_CATEGORY = 0x09,
            RULES_EVENTS_CATEGORY = 0x0A,
            SECURITY_EVENTS_CATEGORY = 0x0B,
            STATUSING_EVENTS_CATEGORY = 0x0C,
            STATUS_REPORTS_EVENTS_CATEGORY = 0x0D,
            TIMESHEET_EVENTS_CATEGORY = 0x0E,
            WSS_INTEROP_EVENTS_CATEGORY = 0x0F,
        }


        #endregion

        #region Event Class IDs

        private enum AdminEventsIDs : int
        {
            REPORTING_PERIOD_UPDATING = 0x00000100,
            REPORTING_PERIOD_UPDATED = 0x00000101,
            LINE_CLASS_UPDATING = 0x00000102,
            LINE_CLASS_UPDATED = 0x00000103,
            STATUS_REPORTS_DELETING = 0x00000104,
            STATUS_REPORTS_DELETED = 0x00000105,
            AD_SYNC_ERPSYNCHRONIZING = 0x00000106,
            AD_SYNC_ERPSYNCHRONIZED = 0x00000107,
            AD_SYNC_GROUP_SYNCHRONIZING = 0x00000108,
            AD_SYNC_GROUP_SYNCHRONIZED = 0x00000109,
            AD_SYNC_GROUPS_SYNCHRONIZING = 0x0000010A,
            AD_SYNC_GROUPS_SYNCHRONIZED = 0x0000010B,
        }

        private static int AdminEventsID(string eventName)
        {
            switch (eventName)
            {
                case "ReportingPeriodUpdating":
                    return (int)AdminEventsIDs.REPORTING_PERIOD_UPDATING;
                case "ReportingPeriodUpdated":
                    return (int)AdminEventsIDs.REPORTING_PERIOD_UPDATED;
                case "LineClassUpdating":
                    return (int)AdminEventsIDs.LINE_CLASS_UPDATING;
                case "LineClassUpdated":
                    return (int)AdminEventsIDs.LINE_CLASS_UPDATED;
                case "StatusReportsDeleting":
                    return (int)AdminEventsIDs.STATUS_REPORTS_DELETING;
                case "StatusReportsDeleted":
                    return (int)AdminEventsIDs.STATUS_REPORTS_DELETED;
                case "AdSyncERPSynchronizing":
                    return (int)AdminEventsIDs.AD_SYNC_ERPSYNCHRONIZING;
                case "AdSyncERPSynchronized":
                    return (int)AdminEventsIDs.AD_SYNC_ERPSYNCHRONIZED;
                case "AdSyncGroupSynchronizing":
                    return (int)AdminEventsIDs.AD_SYNC_GROUP_SYNCHRONIZING;
                case "AdSyncGroupSynchronized":
                    return (int)AdminEventsIDs.AD_SYNC_GROUP_SYNCHRONIZED;
                case "AdSyncGroupsSynchronizing":
                    return (int)AdminEventsIDs.AD_SYNC_GROUPS_SYNCHRONIZING;
                case "AdSyncGroupsSynchronized":
                    return (int)AdminEventsIDs.AD_SYNC_GROUPS_SYNCHRONIZED;
                default:
                    return (int)0;
            }
        }

        private enum CalendarEventsIDs : int
        {
            CREATING = 0x00000200,
            CREATED = 0x00000201,
            DELETING = 0x00000202,
            DELETED = 0x00000203,
            CHANGING = 0x00000204,
            CHANGED = 0x00000205,
            CHECKING_OUT = 0x00000206,
            CHECKED_OUT = 0x00000207,
            CHECKING_IN = 0x00000208,
            CHECKED_IN = 0x00000209,
        }

        private static int CalendarEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Creating":
                    return (int)CalendarEventsIDs.CREATING;
                case "Created":
                    return (int)CalendarEventsIDs.CREATED;
                case "Deleting":
                    return (int)CalendarEventsIDs.DELETING;
                case "Deleted":
                    return (int)CalendarEventsIDs.DELETED;
                case "Changing":
                    return (int)CalendarEventsIDs.CHANGING;
                case "Changed":
                    return (int)CalendarEventsIDs.CHANGED;
                case "CheckingOut":
                    return (int)CalendarEventsIDs.CHECKING_OUT;
                case "CheckedOut":
                    return (int)CalendarEventsIDs.CHECKED_OUT;
                case "CheckingIn":
                    return (int)CalendarEventsIDs.CHECKING_IN;
                case "CheckedIn":
                    return (int)CalendarEventsIDs.CHECKED_IN;
                default:
                    return (int)0;
            }
        }

        private enum CubeAdminEventsIDs : int
        {
            CUBE_BUILDING = 0x00000300,
            CUBE_BUILT = 0x00000301,
            CUBE_PROCESSED = 0x00000302,
        }

        private static int CubeAdminEventsID(string eventName)
        {
            switch (eventName)
            {
                case "CubeBuilding":
                    return (int)CubeAdminEventsIDs.CUBE_BUILDING;
                case "CubeBuilt":
                    return (int)CubeAdminEventsIDs.CUBE_BUILT;
                case "CubeProcessed":
                    return (int)CubeAdminEventsIDs.CUBE_PROCESSED;
                default:
                    return (int)0;
            }
        }

        private enum CustomFieldsEventsIDs : int
        {
            CREATING = 0x00000400,
            CREATED = 0x00000401,
            DELETING = 0x00000402,
            DELETED = 0x00000403,
            UPDATING = 0x00000404,
            UPDATED = 0x00000405,
            CHECKING_OUT = 0x00000406,
            CHECKED_OUT = 0x00000407,
            CHECKING_IN = 0x00000408,
            CHECKED_IN = 0x00000409,
        }

        private static int CustomFieldsEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Creating":
                    return (int)CustomFieldsEventsIDs.CREATING;
                case "Created":
                    return (int)CustomFieldsEventsIDs.CREATED;
                case "Deleting":
                    return (int)CustomFieldsEventsIDs.DELETING;
                case "Deleted":
                    return (int)CustomFieldsEventsIDs.DELETED;
                case "Updating":
                    return (int)CustomFieldsEventsIDs.UPDATING;
                case "Updated":
                    return (int)CustomFieldsEventsIDs.UPDATED;
                case "CheckingOut":
                    return (int)CustomFieldsEventsIDs.CHECKING_OUT;
                case "CheckedOut":
                    return (int)CustomFieldsEventsIDs.CHECKED_OUT;
                case "CheckingIn":
                    return (int)CustomFieldsEventsIDs.CHECKING_IN;
                case "CheckedIn":
                    return (int)CustomFieldsEventsIDs.CHECKED_IN;
                default:
                    return (int)0;
            }
        }

        private enum LookupTableEventsIDs : int
        {
            CREATING = 0x00000500,
            CREATED = 0x00000501,
            DELETING = 0x00000502,
            DELETED = 0x00000503,
            UPDATING = 0x00000504,
            UPDATED = 0x00000505,
            CHECKING_OUT = 0x00000506,
            CHECKED_OUT = 0x00000507,
            CHECKING_IN = 0x00000508,
            CHECKED_IN = 0x00000509,
        }

        private static int LookupTableEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Creating":
                    return (int)LookupTableEventsIDs.CREATING;
                case "Created":
                    return (int)LookupTableEventsIDs.CREATED;
                case "Deleting":
                    return (int)LookupTableEventsIDs.DELETING;
                case "Deleted":
                    return (int)LookupTableEventsIDs.DELETED;
                case "Updating":
                    return (int)LookupTableEventsIDs.UPDATING;
                case "Updated":
                    return (int)LookupTableEventsIDs.UPDATED;
                case "CheckingOut":
                    return (int)LookupTableEventsIDs.CHECKING_OUT;
                case "CheckedOut":
                    return (int)LookupTableEventsIDs.CHECKED_OUT;
                case "CheckingIn":
                    return (int)LookupTableEventsIDs.CHECKING_IN;
                case "CheckedIn":
                    return (int)LookupTableEventsIDs.CHECKED_IN;
                default:
                    return (int)0;
            }
        }

        private enum NotificationsEventsIDs : int
        {
            SENDING = 0x00000600,
            SENT = 0x00000601,
        }

        private static int NotificationsEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Sending":
                    return (int)NotificationsEventsIDs.SENDING;
                case "Sent":
                    return (int)NotificationsEventsIDs.SENT;
                default:
                    return (int)0;
            }
        }

        private enum ProjectEventsIDs : int
        {
            CREATING = 0x00000700,
            CREATED = 0x00000701,
            DELETING = 0x00000702,
            DELETED = 0x00000703,
            SAVED = 0x00000704,
            CHECK_IN = 0x00000705,
            SAVE_FAILED = 0x00000706,
            PUBLISHING = 0x00000707,
            PUBLISHED = 0x00000708,
            WSS_WORKSPACE_ADDRESS_UPDATING = 0x00000709,
            WSS_WORKSPACE_ADDRESS_UPDATED = 0x0000070A,
            WSS_WORKSPACE_ADDRESS_DELETING = 0x0000070B,
            WSS_WORKSPACE_ADDRESS_DELETED = 0x0000070C,
            ACTIVITY_UPGRADING = 0x0000070D,
            ACTIVITY_UPGRADED = 0x0000070E,
            UPDATING = 0x0000070F,
            UPDATED = 0x00000710,
            ADDING = 0x00000711,
            ADDED = 0x00000712,
            ENTITIES_DELETING = 0x00000713,
            ENTITIES_DELETED = 0x00000714,
        }

        private static int ProjectEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Creating":
                    return (int)ProjectEventsIDs.CREATING;
                case "Created":
                    return (int)ProjectEventsIDs.CREATED;
                case "Deleting":
                    return (int)ProjectEventsIDs.DELETING;
                case "Deleted":
                    return (int)ProjectEventsIDs.DELETED;
                case "Saved":
                    return (int)ProjectEventsIDs.SAVED;
                case "CheckIn":
                    return (int)ProjectEventsIDs.CHECK_IN;
                case "SaveFailed":
                    return (int)ProjectEventsIDs.SAVE_FAILED;
                case "Publishing":
                    return (int)ProjectEventsIDs.PUBLISHING;
                case "Published":
                    return (int)ProjectEventsIDs.PUBLISHED;
                case "WssWorkspaceAddressUpdating":
                    return (int)ProjectEventsIDs.WSS_WORKSPACE_ADDRESS_UPDATING;
                case "WssWorkspaceAddressUpdated":
                    return (int)ProjectEventsIDs.WSS_WORKSPACE_ADDRESS_UPDATED;
                case "WssWorkspaceAddressDeleting":
                    return (int)ProjectEventsIDs.WSS_WORKSPACE_ADDRESS_DELETING;
                case "WssWorkspaceAddressDeleted":
                    return (int)ProjectEventsIDs.WSS_WORKSPACE_ADDRESS_DELETED;
                case "ActivityUpgrading":
                    return (int)ProjectEventsIDs.ACTIVITY_UPGRADING;
                case "ActivityUpgraded":
                    return (int)ProjectEventsIDs.ACTIVITY_UPGRADED;
                case "Updating":
                    return (int)ProjectEventsIDs.UPDATING;
                case "Updated":
                    return (int)ProjectEventsIDs.UPDATED;
                case "Adding":
                    return (int)ProjectEventsIDs.ADDING;
                case "Added":
                    return (int)ProjectEventsIDs.ADDED;
                case "EntitiesDeleting":
                    return (int)ProjectEventsIDs.ENTITIES_DELETING;
                case "EntitiesDeleted":
                    return (int)ProjectEventsIDs.ENTITIES_DELETED;
                default:
                    return (int)0;
            }
        }

        private enum ReportingEventsIDs : int
        {
            RESOURCE_CAPACITIES_CHANGED = 0x00000800,
            CUSTOM_FIELD_CREATED = 0x00000801,
            CUSTOM_FIELD_CHANGED = 0x00000802,
            CUSTOM_FIELD_DELETED = 0x00000803,
            USER_VIEW_CHANGED = 0x00000804,
            FISCAL_PERIOD_CHANGED = 0x00000805,
            FISCAL_PERIOD_DELETED = 0x00000806,
            LOOKUP_TABLE_CREATED = 0x00000807,
            LOOKUP_TABLE_CHANGED = 0x00000808,
            LOOKUP_TABLE_DELETED = 0x00000809,
            PROJECT_CREATED = 0x0000080A,
            PROJECT_CHANGED = 0x0000080B,
            PROJECT_DELETED = 0x0000080C,
            RESOURCE_CAPACITY_TIME_RANGE_CHANGED = 0x0000080D,
            RESOURCE_CREATED = 0x0000080E,
            RESOURCE_CHANGED = 0x0000080F,
            RESOURCE_DELETED = 0x00000810,
            TIMESHEET_SAVED = 0x00000811,
            TIMESHEET_ADJUSTED = 0x00000812,
            TIMESHEET_DELETED = 0x00000813,
            TIMESHEET_CLASS_CHANGED = 0x00000814,
            TIMESHEET_PERIOD_CREATED = 0x00000815,
            TIMESHEET_PERIOD_CHANGED = 0x00000816,
            TIMESHEET_PERIOD_DELETED = 0x00000817,
            TIMESHEET_STATUS_CHANGED = 0x00000818,
            PROJECT_WORKSPACE_CREATED = 0x00000819,
            PROJECT_WORKSPACE_CHANGED = 0x0000081A,
            PROJECT_WORKSPACE_DELETED = 0x0000081B,
        }

        private static int ReportingEventsID(string eventName)
        {
            switch (eventName)
            {
                case "ResourceCapacitiesChanged":
                    return (int)ReportingEventsIDs.RESOURCE_CAPACITIES_CHANGED;
                case "CustomFieldCreated":
                    return (int)ReportingEventsIDs.CUSTOM_FIELD_CREATED;
                case "CustomFieldChanged":
                    return (int)ReportingEventsIDs.CUSTOM_FIELD_CHANGED;
                case "CustomFieldDeleted":
                    return (int)ReportingEventsIDs.CUSTOM_FIELD_DELETED;
                case "UserViewChanged":
                    return (int)ReportingEventsIDs.USER_VIEW_CHANGED;
                case "FiscalPeriodChanged":
                    return (int)ReportingEventsIDs.FISCAL_PERIOD_CHANGED;
                case "FiscalPeriodDeleted":
                    return (int)ReportingEventsIDs.FISCAL_PERIOD_DELETED;
                case "LookupTableCreated":
                    return (int)ReportingEventsIDs.LOOKUP_TABLE_CREATED;
                case "LookupTableChanged":
                    return (int)ReportingEventsIDs.LOOKUP_TABLE_CHANGED;
                case "LookupTableDeleted":
                    return (int)ReportingEventsIDs.LOOKUP_TABLE_DELETED;
                case "ProjectCreated":
                    return (int)ReportingEventsIDs.PROJECT_CREATED;
                case "ProjectChanged":
                    return (int)ReportingEventsIDs.PROJECT_CHANGED;
                case "ProjectDeleted":
                    return (int)ReportingEventsIDs.PROJECT_DELETED;
                case "ResourceCapacityTimeRangeChanged":
                    return (int)ReportingEventsIDs.RESOURCE_CAPACITY_TIME_RANGE_CHANGED;
                case "ResourceCreated":
                    return (int)ReportingEventsIDs.RESOURCE_CREATED;
                case "ResourceChanged":
                    return (int)ReportingEventsIDs.RESOURCE_CHANGED;
                case "ResourceDeleted":
                    return (int)ReportingEventsIDs.RESOURCE_DELETED;
                case "TimesheetSaved":
                    return (int)ReportingEventsIDs.TIMESHEET_SAVED;
                case "TimesheetAdjusted":
                    return (int)ReportingEventsIDs.TIMESHEET_ADJUSTED;
                case "TimesheetDeleted":
                    return (int)ReportingEventsIDs.TIMESHEET_DELETED;
                case "TimesheetClassChanged":
                    return (int)ReportingEventsIDs.TIMESHEET_CLASS_CHANGED;
                case "TimesheetPeriodCreated":
                    return (int)ReportingEventsIDs.TIMESHEET_PERIOD_CREATED;
                case "TimesheetPeriodChanged":
                    return (int)ReportingEventsIDs.TIMESHEET_PERIOD_CHANGED;
                case "TimesheetPeriodDeleted":
                    return (int)ReportingEventsIDs.TIMESHEET_PERIOD_DELETED;
                case "TimesheetStatusChanged":
                    return (int)ReportingEventsIDs.TIMESHEET_STATUS_CHANGED;
                case "ProjectWorkspaceCreated":
                    return (int)ReportingEventsIDs.PROJECT_WORKSPACE_CREATED;
                case "ProjectWorkspaceChanged":
                    return (int)ReportingEventsIDs.PROJECT_WORKSPACE_CHANGED;
                case "ProjectWorkspaceDeleted":
                    return (int)ReportingEventsIDs.PROJECT_WORKSPACE_DELETED;
                default:
                    return (int)0;
            }
        }

        private enum ResourceEventsIDs : int
        {
            CREATING = 0x00000900,
            CREATED = 0x00000901,
            DELETING = 0x00000902,
            DELETED = 0x00000903,
            DEACTIVATING = 0x00000904,
            DEACTIVATED = 0x00000905,
            CHANGING = 0x00000906,
            CHANGED = 0x00000907,
            ACTIVATING = 0x00000908,
            ACTIVATED = 0x00000909,
            CHECKING_OUT = 0x0000090A,
            CHECKED_OUT = 0x0000090B,
            CHECKING_IN = 0x0000090C,
            CHECKED_IN = 0x0000090D,
            SETTING_AUTHORIZATION = 0x0000090E,
            SET_AUTHORIZATION = 0x0000090F,
        }

        private static int ResourceEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Creating":
                    return (int)ResourceEventsIDs.CREATING;
                case "Created":
                    return (int)ResourceEventsIDs.CREATED;
                case "Deleting":
                    return (int)ResourceEventsIDs.DELETING;
                case "Deleted":
                    return (int)ResourceEventsIDs.DELETED;
                case "Deactivating":
                    return (int)ResourceEventsIDs.DEACTIVATING;
                case "Deactivated":
                    return (int)ResourceEventsIDs.DEACTIVATED;
                case "Changing":
                    return (int)ResourceEventsIDs.CHANGING;
                case "Changed":
                    return (int)ResourceEventsIDs.CHANGED;
                case "Activating":
                    return (int)ResourceEventsIDs.ACTIVATING;
                case "Activated":
                    return (int)ResourceEventsIDs.ACTIVATED;
                case "CheckingOut":
                    return (int)ResourceEventsIDs.CHECKING_OUT;
                case "CheckedOut":
                    return (int)ResourceEventsIDs.CHECKED_OUT;
                case "CheckingIn":
                    return (int)ResourceEventsIDs.CHECKING_IN;
                case "CheckedIn":
                    return (int)ResourceEventsIDs.CHECKED_IN;
                case "SettingAuthorization":
                    return (int)ResourceEventsIDs.SETTING_AUTHORIZATION;
                case "SetAuthorization":
                    return (int)ResourceEventsIDs.SET_AUTHORIZATION;
                default:
                    return (int)0;
            }
        }

        private enum RulesEventsIDs : int
        {
            CREATING = 0x00000A00,
            CREATED = 0x00000A01,
            DELETING = 0x00000A02,
            DELETED = 0x00000A03,
            COPYING = 0x00000A04,
            COPIED = 0x00000A05,
            PROCESSING = 0x00000A06,
            PROCESSED = 0x00000A07,
        }

        private static int RulesEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Creating":
                    return (int)RulesEventsIDs.CREATING;
                case "Created":
                    return (int)RulesEventsIDs.CREATED;
                case "Deleting":
                    return (int)RulesEventsIDs.DELETING;
                case "Deleted":
                    return (int)RulesEventsIDs.DELETED;
                case "Copying":
                    return (int)RulesEventsIDs.COPYING;
                case "Copied":
                    return (int)RulesEventsIDs.COPIED;
                case "Processing":
                    return (int)RulesEventsIDs.PROCESSING;
                case "Processed":
                    return (int)RulesEventsIDs.PROCESSED;
                default:
                    return (int)0;
            }
        }

        private enum SecurityEventsIDs : int
        {
            ORGANIZATIONAL_PERMISSIONS_UPDATING = 0x00000B00,
            ORGANIZATIONAL_PERMISSIONS_UPDATED = 0x00000B01,
            GROUP_DELETING = 0x00000B02,
            GROUP_DELETED = 0x00000B03,
            GROUP_CREATING = 0x00000B04,
            GROUP_CREATED = 0x00000B05,
            GROUP_UPDATING = 0x00000B06,
            GROUP_UPDATED = 0x00000B07,
            CATEGORY_DELETING = 0x00000B08,
            CATEGORY_DELETED = 0x00000B09,
            CATEGORY_CREATING = 0x00000B0A,
            CATEGORY_CREATED = 0x00000B0B,
            CATEGORY_UPDATING = 0x00000B0C,
            CATEGORY_UPDATED = 0x00000B0D,
            TEMPLATE_CREATING = 0x00000B0E,
            TEMPLATE_CREATED = 0x00000B0F,
            TEMPLATE_UPDATING = 0x00000B10,
            TEMPLATE_UPDATED = 0x00000B11,
            TEMPLATE_DELETING = 0x00000B12,
            TEMPLATE_DELETED = 0x00000B13,
        }

        private static int SecurityEventsID(string eventName)
        {
            switch (eventName)
            {
                case "OrganizationalPermissionsUpdating":
                    return (int)SecurityEventsIDs.ORGANIZATIONAL_PERMISSIONS_UPDATING;
                case "OrganizationalPermissionsUpdated":
                    return (int)SecurityEventsIDs.ORGANIZATIONAL_PERMISSIONS_UPDATED;
                case "GroupDeleting":
                    return (int)SecurityEventsIDs.GROUP_DELETING;
                case "GroupDeleted":
                    return (int)SecurityEventsIDs.GROUP_DELETED;
                case "GroupCreating":
                    return (int)SecurityEventsIDs.GROUP_CREATING;
                case "GroupCreated":
                    return (int)SecurityEventsIDs.GROUP_CREATED;
                case "GroupUpdating":
                    return (int)SecurityEventsIDs.GROUP_UPDATING;
                case "GroupUpdated":
                    return (int)SecurityEventsIDs.GROUP_UPDATED;
                case "CategoryDeleting":
                    return (int)SecurityEventsIDs.CATEGORY_DELETING;
                case "CategoryDeleted":
                    return (int)SecurityEventsIDs.CATEGORY_DELETED;
                case "CategoryCreating":
                    return (int)SecurityEventsIDs.CATEGORY_CREATING;
                case "CategoryCreated":
                    return (int)SecurityEventsIDs.CATEGORY_CREATED;
                case "CategoryUpdating":
                    return (int)SecurityEventsIDs.CATEGORY_UPDATING;
                case "CategoryUpdated":
                    return (int)SecurityEventsIDs.CATEGORY_UPDATED;
                case "TemplateCreating":
                    return (int)SecurityEventsIDs.TEMPLATE_CREATING;
                case "TemplateCreated":
                    return (int)SecurityEventsIDs.TEMPLATE_CREATED;
                case "TemplateUpdating":
                    return (int)SecurityEventsIDs.TEMPLATE_UPDATING;
                case "TemplateUpdated":
                    return (int)SecurityEventsIDs.TEMPLATE_UPDATED;
                case "TemplateDeleting":
                    return (int)SecurityEventsIDs.TEMPLATE_DELETING;
                case "TemplateDeleted":
                    return (int)SecurityEventsIDs.TEMPLATE_DELETED;
                default:
                    return (int)0;
            }
        }

        private enum StatusingEventsIDs : int
        {
            APPLYING = 0x00000C00,
            APPLIED = 0x00000C01,
            HISTORY_DELETING = 0x00000C02,
            HISTORY_DELETED = 0x00000C03,
            STATUS_UPDATING = 0x00000C04,
            STATUS_UPDATED = 0x00000C05,
            STATUS_SUBMITING = 0x00000C06,
            STATUS_SUBMITTED = 0x00000C07,
            ASSIGNMENT_DELETING = 0x00000C08,
            ASSIGNMENT_DELETED = 0x00000C09,
            ASSIGNMENT_DELEGATING = 0x00000C0A,
            ASSIGNMENT_DELEGATED = 0x00000C0B,
            TASK_CREATING = 0x00000C0C,
            TASK_CREATED = 0x00000C0D,
            ASSIGNMENT_WORK_DATA_SETTING = 0x00000C0E,
            ASSIGNMENT_WORK_DATA_SET = 0x00000C0F,
            APPROVALS_UPDATING = 0x00000C10,
            APPROVALS_UPDATED = 0x00000C11,
        }

        private static int StatusingEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Applying":
                    return (int)StatusingEventsIDs.APPLYING;
                case "Applied":
                    return (int)StatusingEventsIDs.APPLIED;
                case "HistoryDeleting":
                    return (int)StatusingEventsIDs.HISTORY_DELETING;
                case "HistoryDeleted":
                    return (int)StatusingEventsIDs.HISTORY_DELETED;
                case "StatusUpdating":
                    return (int)StatusingEventsIDs.STATUS_UPDATING;
                case "StatusUpdated":
                    return (int)StatusingEventsIDs.STATUS_UPDATED;
                case "StatusSubmiting":
                    return (int)StatusingEventsIDs.STATUS_SUBMITING;
                case "StatusSubmitted":
                    return (int)StatusingEventsIDs.STATUS_SUBMITTED;
                case "AssignmentDeleting":
                    return (int)StatusingEventsIDs.ASSIGNMENT_DELETING;
                case "AssignmentDeleted":
                    return (int)StatusingEventsIDs.ASSIGNMENT_DELETED;
                case "AssignmentDelegating":
                    return (int)StatusingEventsIDs.ASSIGNMENT_DELEGATING;
                case "AssignmentDelegated":
                    return (int)StatusingEventsIDs.ASSIGNMENT_DELEGATED;
                case "TaskCreating":
                    return (int)StatusingEventsIDs.TASK_CREATING;
                case "TaskCreated":
                    return (int)StatusingEventsIDs.TASK_CREATED;
                case "AssignmentWorkDataSetting":
                    return (int)StatusingEventsIDs.ASSIGNMENT_WORK_DATA_SETTING;
                case "AssignmentWorkDataSet":
                    return (int)StatusingEventsIDs.ASSIGNMENT_WORK_DATA_SET;
                case "ApprovalsUpdating":
                    return (int)StatusingEventsIDs.APPROVALS_UPDATING;
                case "ApprovalsUpdated":
                    return (int)StatusingEventsIDs.APPROVALS_UPDATED;
                default:
                    return (int)0;
            }
        }

        private enum StatusReportsEventsIDs : int
        {
            REQUEST_CREATING = 0x00000D00,
            REQUEST_CREATED = 0x00000D01,
            REQUEST_UPDATING = 0x00000D02,
            REQUEST_UPDATED = 0x00000D03,
            RESPONSE_CREATING = 0x00000D04,
            RESPONSE_CREATED = 0x00000D05,
            RESPONSE_UPDATING = 0x00000D06,
            RESPONSE_UPDATED = 0x00000D07,
        }

        private static int StatusReportsEventsID(string eventName)
        {
            switch (eventName)
            {
                case "RequestCreating":
                    return (int)StatusReportsEventsIDs.REQUEST_CREATING;
                case "RequestCreated":
                    return (int)StatusReportsEventsIDs.REQUEST_CREATED;
                case "RequestUpdating":
                    return (int)StatusReportsEventsIDs.REQUEST_UPDATING;
                case "RequestUpdated":
                    return (int)StatusReportsEventsIDs.REQUEST_UPDATED;
                case "ResponseCreating":
                    return (int)StatusReportsEventsIDs.RESPONSE_CREATING;
                case "ResponseCreated":
                    return (int)StatusReportsEventsIDs.RESPONSE_CREATED;
                case "ResponseUpdating":
                    return (int)StatusReportsEventsIDs.RESPONSE_UPDATING;
                case "ResponseUpdated":
                    return (int)StatusReportsEventsIDs.RESPONSE_UPDATED;
                default:
                    return (int)0;
            }
        }

        private enum TimesheetEventsIDs : int
        {
            CREATING = 0x00000E00,
            CREATED = 0x00000E01,
            DELETING = 0x00000E02,
            DELETED = 0x00000E03,
            UPDATING = 0x00000E04,
            UPDATED = 0x00000E05,
            SUBMITTING = 0x00000E06,
            SUBMITTED = 0x00000E07,
            RECALLING = 0x00000E08,
            RECALLED = 0x00000E09,
            REVIEWING = 0x00000E0A,
            REVIEWED = 0x00000E0B,
            LINE_APPROVING = 0x00000E0C,
            LINE_APPROVED = 0x00000E0D,
        }

        private static int TimesheetEventsID(string eventName)
        {
            switch (eventName)
            {
                case "Creating":
                    return (int)TimesheetEventsIDs.CREATING;
                case "Created":
                    return (int)TimesheetEventsIDs.CREATED;
                case "Deleting":
                    return (int)TimesheetEventsIDs.DELETING;
                case "Deleted":
                    return (int)TimesheetEventsIDs.DELETED;
                case "Updating":
                    return (int)TimesheetEventsIDs.UPDATING;
                case "Updated":
                    return (int)TimesheetEventsIDs.UPDATED;
                case "Submitting":
                    return (int)TimesheetEventsIDs.SUBMITTING;
                case "Submitted":
                    return (int)TimesheetEventsIDs.SUBMITTED;
                case "Recalling":
                    return (int)TimesheetEventsIDs.RECALLING;
                case "Recalled":
                    return (int)TimesheetEventsIDs.RECALLED;
                case "Reviewing":
                    return (int)TimesheetEventsIDs.REVIEWING;
                case "Reviewed":
                    return (int)TimesheetEventsIDs.REVIEWED;
                case "LineApproving":
                    return (int)TimesheetEventsIDs.LINE_APPROVING;
                case "LineApproved":
                    return (int)TimesheetEventsIDs.LINE_APPROVED;
                default:
                    return (int)0;
            }
        }

        private enum WssInteropEventsIDs : int
        {
            WSS_WORKSPACE_CREATING = 0x00000F00,
            WSS_WORKSPACE_CREATED = 0x00000F01,
        }

        private static int WssInteropEventsID(string eventName)
        {
            switch (eventName)
            {
                case "WssWorkspaceCreating":
                    return (int)WssInteropEventsIDs.WSS_WORKSPACE_CREATING;
                case "WssWorkspaceCreated":
                    return (int)WssInteropEventsIDs.WSS_WORKSPACE_CREATED;
                default:
                    return (int)0;
            }
        }


        #endregion

    }
}
